import 'package:flutter/material.dart';
import 'package:flutter_chat/common/style/styles.dart';

class Info extends StatelessWidget {
  final String title;
  final Widget avatar;
  final Function() onTap;
  const Info({
    super.key,
    required this.avatar,
    required this.title,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        color: Colors.white,
        child: ListTile(
          dense: true,
          contentPadding: const EdgeInsets.symmetric(
            vertical: 5,
            horizontal: AppTheme.largeSpace,
          ),
          horizontalTitleGap: AppTheme.largeSpace,
          title: Text(
            title,
            overflow: TextOverflow.ellipsis,
            style: const TextStyle(
              fontSize: AppTheme.largeFont,
            ),
          ),
          leading: avatar,
        ),
      ),
    );
  }
}
